package com.suxin.plugin.intergration.factory;

import com.suxin.plugin.intergration.PluginListenerContext;
import com.suxin.plugin.intergration.manager.PluginWrapper;

/**
 * @author Tang
 * @classname PluginFactory
 * @description [ 插件注册接口 ]
 * @date 2022/7/18 21:02
 */
public interface PluginFactory extends PluginListenerContext {

    /**
     * 工厂初始化
     * @throws Exception
     */
    void initialize() throws Exception;

    /**
     * 插件注册
     * @param pluginWrapper
     * @return
     * @throws Exception
     */
    PluginFactory registry(PluginWrapper pluginWrapper) throws Exception;

    /**
     * 插件卸载
     * @param pluginId
     * @return
     * @throws Exception
     */
    PluginFactory unRegistry(String pluginId) throws Exception;

    /**
     * 注册或销毁后的构建调用
     * @throws Exception
     */
    void build() throws Exception;
}